<template>
  <ElDrawer
    :modelValue="modelValue"
    :title="title"
    :direction="direction"
    @close="handlerClose"
  >
    <template #header>
      <div>设置系统主体色</div>
    </template>
    <template #default>
      <ThemePicker></ThemePicker>
    </template>
  </ElDrawer>
</template>

<script lang="ts" setup>
import type { DrawerProps } from "element-plus";
import type { PropType } from "vue";

//定义接受从父组件传递过来的属性(props)
defineProps({
  modelValue: {
    type: Boolean,
    default: false
  },
  direction: {
    type: String as PropType<DrawerProps["direction"]>,
    default: "rtl"
  },
  title: {
    type: String,
    default: ""
  }
});
const emit = defineEmits(["update:modelValue"]);
const handlerClose = () => {
  console.log("3.关闭pannel");
  emit("update:modelValue", false);
};
</script>

<style lang="scss" scoped></style>
